//
//  MyInformation.m
//  有材网
//
//  Created by 肖扬 on 16/1/20.
//  Copyright © 2016年 肖扬. All rights reserved.
//

#import "MyInformation.h"

@implementation MyInformation
@synthesize data;
-(id)init{
    self = [super init];
    if (self) {
        self.data = [NSMutableDictionary dictionary];
    }
    return self;
}
-(void)parseResponseData:(NSString *)responseString{
    [super parseResponseData:responseString];
    NSMutableDictionary *dic = [responseString objectFromJSONString];
    NSMutableDictionary *jsonData = [dic objectForKey:@"data"];
    if ([jsonData isKindOfClass:[NSArray array]]) {
        return;
    }
    if ([jsonData objectForKey:@"member"]!=nil) {
        NSMutableDictionary *member = [jsonData objectForKey:@"member"];
        memberModel *model = [[memberModel alloc]init];
        model.mid = [member objectForKey:@"mid"];
        model.nickname = [member objectForKey:@"nickname"];
        model.mobile = [member objectForKey:@"mobile"];
        model.mobile_verified = [member objectForKey:@"mobile_verified"];
        model.company_name = [member objectForKey:@"company_name"];
        model.qq = [member objectForKey:@"qq"];
        model.email = [member objectForKey:@"email"];
        model.status = [member objectForKey:@"status"];
        model.dealer = [member objectForKey:@"dealer"];
        model.referee = [member objectForKey:@"referee"];
        model.client_model = [member objectForKey:@"client_model"];
        model.client_os = [member objectForKey:@"client_os"];
        model.client_os_version = [member objectForKey:@"client_os_version"];
        model.client_latitude = [member objectForKey:@"client_latitude"];
        model.client_longitude = [member objectForKey:@"client_longitude"];
        model.client_device = [member objectForKey:@"client_device"];
        model.app_version = [member objectForKey:@"app_version"];
        model.ctime = [member objectForKey:@"ctime"];
        [self.data setObject:model forKey:@"member"];
    }
    
    if ([jsonData objectForKey:@"company"]!=nil) {
        NSMutableDictionary *infoDic = [NSMutableDictionary dictionary];
        NSMutableDictionary *company = [jsonData objectForKey:@"company"];
        companyModel *model = [[companyModel alloc]init];
        model.mid = [company objectForKey:@"mid"];
        model.company_name = [company objectForKey:@"company_name"];
        model.country = [company objectForKey:@"country"];
        model.province = [company objectForKey:@"province"];
        model.city = [company objectForKey:@"city"];
        model.address = [company objectForKey:@"address"];
        model.business = [company objectForKey:@"business"];
        model.tel_pre = [company objectForKey:@"tel_pre"];
        model.tel = [company objectForKey:@"tel"];
        model.license_code = [company objectForKey:@"license_code"];
        model.license_file = [company objectForKey:@"license_file"];
        model.license_audit_id = [company objectForKey:@"license_audit_id"];
        model.intro = [company objectForKey:@"intro"];
        model.zipcode = [company objectForKey:@"zipcode"];
        model.company_site = [company objectForKey:@"company_site"];
        model.mtime = [company objectForKey:@"mtime"];
        model.license_status = [company objectForKey:@"license_status"];
        model.ctime = [company objectForKey:@"ctime"];
        [self.data setObject:model forKey:@"company"];
    }
}
@end

@implementation memberModel

@synthesize mid,nickname,mobile,mobile_verified,company_name,qq;
@synthesize email,status,dealer,referee,client_model,client_os;
@synthesize client_os_version,client_latitude,client_longitude;
@synthesize client_device,app_version,ctime;

@end


@implementation companyModel

@synthesize mid,company_name,country,province,city,address,business;
@synthesize tel_pre,tel,license_code,license_file,license_audit_id;
@synthesize intro,zipcode,company_site,mtime,ctime,license_status;

@end